package org.gameg.schedule;


import org.gameg.Api.Service.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Configurable
@EnableScheduling
public class ApiSchedule {
    @Autowired
    private ApiService apiService;

    /**
     * 每天0点执行
     * 执行反水活动
     */
    @Scheduled(cron = "0 0 0 */1 * * ")
    public void rebate(){
        apiService.rebate();
    }

    /**
     * 每天按照规定时间点执行
     * 连赢奖励发放
     */
    @Scheduled(cron = "0 0 0 */1 * * ")
    public void giveAword(){
        apiService.giveAword();
    }
}
